UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sBozZZ5BCCpPgtICx1V8IZQuhiuMHjuiHMcnB9sagGs='
WHERE
key_id = '6c1d2b0e15cb3038c0f712813c035c6abb29b2835cadc77590e60d66a0a5b45f'
AND (
token = 'sBozZZ5BCCpPgtICx1V8IZQuhiuMHjuiHMcnB9sagGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)