UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EML97N2lkRqso1TF1fLYBOO2DEJ9JmjOh2gwVynE/NI=' 
WHERE 
  key_id = '458d2393b7e5bd7412d6bf61b60b2da6db6c61b69e9a104f1b52583b8935686a' 
  AND (
    token = 'EML97N2lkRqso1TF1fLYBOO2DEJ9JmjOh2gwVynE/NI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051