UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HEAq2o/D4TLdpcEkiCy2ECEUc5JWgNB7mu46bUKwdjQ=' 
WHERE 
  key_id = 'db532b9057e34ebe7d80621fbf6600f27cd48a20382e9fc752f14d4012e45e9d' 
  AND (
    token = 'HEAq2o/D4TLdpcEkiCy2ECEUc5JWgNB7mu46bUKwdjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014