UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/MNPeeJTsTY7JDItNc4TSGJZg0VrXnedB1p3rQ/ETk0=' 
WHERE 
  key_id = 'f9d301cf5d43565405b9584f8564f9de34ead8da084a278926d6482baa7156af' 
  AND (
    token = '/MNPeeJTsTY7JDItNc4TSGJZg0VrXnedB1p3rQ/ETk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036