UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yi2Y+nj4BVuTgm8RUy1oK8IHkaNam/pufWuzLO+JCNU=' 
WHERE 
  key_id = '0feba12a472bb0cb9b10883a1ddd200d5b8cbcac54cc6bf5b1c7467e0561922f' 
  AND (
    token = 'Yi2Y+nj4BVuTgm8RUy1oK8IHkaNam/pufWuzLO+JCNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00376