UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mtzgwS6bgqhNpaUgfCsmeQko+NE297I4bKPirFa14zA='
WHERE
key_id = '29a2053b8ea7f772c29b7765cf94a115326e92a4369363571cb509e52fb0a5be'
AND (
token = 'mtzgwS6bgqhNpaUgfCsmeQko+NE297I4bKPirFa14zA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)