UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BR4rWIT01BYGs093mNLRH67S7TZr6bK8Eobo0gE70Go=' 
WHERE 
  key_id = '7fcf42306748260b4e8c0bf5886ef6a5f16598bd5b9571d9a2c18e0572b1738f' 
  AND (
    token = 'BR4rWIT01BYGs093mNLRH67S7TZr6bK8Eobo0gE70Go=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048