UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z/HRMhG6hwH4PvMl5RpsQHcuTl8fir8VH5JaheGVSvQ='
WHERE
key_id = 'f1e8cd7c3e1ff19fa6812bb1b711287b48de94b84b0e3811868e543c4c3f526b'
AND (
token = 'Z/HRMhG6hwH4PvMl5RpsQHcuTl8fir8VH5JaheGVSvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)