UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+WqOPqDsseuyC3USezIncHnjm//PSrAsn9VTrJ4f5GA=' 
WHERE 
  key_id = 'a6f6779c467f27cb496d9fbc19db62c9a9b81596cb334fe48acb5507b440539b' 
  AND (
    token = '+WqOPqDsseuyC3USezIncHnjm//PSrAsn9VTrJ4f5GA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043