UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5zK3dCBuLD5nhftIxI0qmTAf0aU4K1TfErJYT/qf2xg=' 
WHERE 
  key_id = '7d2fd8766f0edd6da568f70364103d1e60c2384b5f5ba113d25b1a1a71be94c8' 
  AND (
    token = '5zK3dCBuLD5nhftIxI0qmTAf0aU4K1TfErJYT/qf2xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026