UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jLPh1w2R9NHFKt2S/Qu3aXhWdsJAyokGdlfPA4wi77A='
WHERE
key_id = '64e64737286727a956e7402b090910a5a955128348eb51544c28f1969718710c'
AND (
token = 'jLPh1w2R9NHFKt2S/Qu3aXhWdsJAyokGdlfPA4wi77A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)