UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8uQ7XMmEw5tExd5W+eol8qzxqPTv+axS4DFzRGDzFp8=' 
WHERE 
  key_id = 'b8ab61af4e0265a7a550cb9070e89f5aa410761f8f5086d0af4959f01f3d3d81' 
  AND (
    token = '8uQ7XMmEw5tExd5W+eol8qzxqPTv+axS4DFzRGDzFp8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033