UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F6IzZa9017bwt4OgsobyiLoOucbiTxH2ROlh0CFF23U='
WHERE
key_id = '32e4dfa87225a10174a03b2b2f9e0b530bd26300a29f429d1f88a89b2617791c'
AND (
token = 'F6IzZa9017bwt4OgsobyiLoOucbiTxH2ROlh0CFF23U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)