UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XCmKGFF2mNWHlVIKR+8WJwWASbVxT7CsDYmvaqyywY='
WHERE
key_id = '6285161924a308d86dc804a68fbb1ce4595cdbcd536212e7732dacfcb96b8483'
AND (
token = '1XCmKGFF2mNWHlVIKR+8WJwWASbVxT7CsDYmvaqyywY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)