UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0I/Ut2kddpE/c0cwCPb3Y19biB1/6ARhPqd6V6UnTG4='
WHERE
key_id = '3f32d62df36e4980a7d745db20a64d225c100920d6850915f6b6d39699c44e5f'
AND (
token = '0I/Ut2kddpE/c0cwCPb3Y19biB1/6ARhPqd6V6UnTG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)