UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jB0I1KwcheUjsFGTU25uJJJzItbL7/IoTT0n3+zEFWI='
WHERE
key_id = '823e3cdda46e816ff4735b27915c96f0af658dba02f32810a63b351ddddc7951'
AND (
token = 'jB0I1KwcheUjsFGTU25uJJJzItbL7/IoTT0n3+zEFWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)