UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uZ5yAhDIuerssDxlv+UBx//qzxY/sYLma88/+Jqxr5E='
WHERE
key_id = 'c1e5178d992fecfdccb45188a387770844814c19b05e2392c96c92ed2323210f'
AND (
token = 'uZ5yAhDIuerssDxlv+UBx//qzxY/sYLma88/+Jqxr5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)