UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bEBkc+F8lN76PkvJP8P0TkmLpwMDtlTUOEVGLqNV53M=' 
WHERE 
  key_id = 'f70168d5720f57349c9e2033e5ffb0a34fe64b7ee0b2a23f36a989f9760a8a21' 
  AND (
    token = 'bEBkc+F8lN76PkvJP8P0TkmLpwMDtlTUOEVGLqNV53M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021