UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'anw9+EPt8Ip2DGz0L1G9vxmQ/hdI5GGkr+wK0wbgE/8='
WHERE
key_id = 'c8e760e3796ed3873ea32e2a17ab1984d1e897fbd70547af65220f9f649f3345'
AND (
token = 'anw9+EPt8Ip2DGz0L1G9vxmQ/hdI5GGkr+wK0wbgE/8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)