UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9DgDMMyHeAml5k/cSDpAuWI2gXJymBTaNaPxkmulpUE=' 
WHERE 
  key_id = '102309c9cfca1ebe06223a4f5418ef26917304c219284556bcccb1a0bc570d08' 
  AND (
    token = '9DgDMMyHeAml5k/cSDpAuWI2gXJymBTaNaPxkmulpUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061