UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TEmp1d/pn1lIhbbwkLcu6dIEjztROKusEgAGkfPtU34='
WHERE
key_id = '204423ad3245e4f64cd0e4a4d2746808befad3488dc55e7469999669c8aed095'
AND (
token = 'TEmp1d/pn1lIhbbwkLcu6dIEjztROKusEgAGkfPtU34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)