UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2oYp/VVBed5Lzc7CIq9iD3eWENAZ7Ww+/mCUVlYurUk=' 
WHERE 
  key_id = 'ec2bd53f4bc69304eb0d866294a6bc4061039ac6e1d32157a8640c4a817e4f95' 
  AND (
    token = '2oYp/VVBed5Lzc7CIq9iD3eWENAZ7Ww+/mCUVlYurUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037