UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tTCi4Kc1fogkHDI75lQWv9r3mE3SFJipKJrzBlZo4dE='
WHERE
key_id = '438fcc083a7dfd3ba323ca92722772241da9688e46bfb57af402ee6809406299'
AND (
token = 'tTCi4Kc1fogkHDI75lQWv9r3mE3SFJipKJrzBlZo4dE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)