UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'chdciGrtLtzOEFC5G2/i+tuM0Bkt2QEGHyVeqxQvWRw=' 
WHERE 
  key_id = 'eeaada296f3314c1457280f54268e1d963f2fda252f09347a58dca7998db2ba3' 
  AND (
    token = 'chdciGrtLtzOEFC5G2/i+tuM0Bkt2QEGHyVeqxQvWRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00095