UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YDp+lo4S+qKcjKTnkfv8Fe0ERl4GSTE6QU0eQbUgCQk='
WHERE
key_id = '8d41c6a5a8f39d43c2b139c99fef09a54e2b93fb970e1f8e7a34d6d415820485'
AND (
token = 'YDp+lo4S+qKcjKTnkfv8Fe0ERl4GSTE6QU0eQbUgCQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)