UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'msrBWvOHnxqczqAFYRa1S5AoInOEbyzfU893Tk/2j68='
WHERE
key_id = '4fc5f32e354fc5e4e50b4b3c75461297631a057585a83058f158e7b1de38ffb7'
AND (
token = 'msrBWvOHnxqczqAFYRa1S5AoInOEbyzfU893Tk/2j68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)