UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H4EqboR7DS4ulReFYKGUUut6B7mixyD1aYJNc+Uj4uA=' 
WHERE 
  key_id = '9ebdeb1590f21ef8ac95abfc654b093ba7d1920fd6b4cf5eb977b5dac8aafdc8' 
  AND (
    token = 'H4EqboR7DS4ulReFYKGUUut6B7mixyD1aYJNc+Uj4uA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039