UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JEzc22lqfHPgS3ohRsLxkUUL/GPCHsFc9WP2LUKkeJ4=' 
WHERE 
  key_id = 'e955b15fe827a3eb8890cf302347bf4488da3fa97cefd6a805450e3806773edd' 
  AND (
    token = 'JEzc22lqfHPgS3ohRsLxkUUL/GPCHsFc9WP2LUKkeJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026