UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8OBmb3+FKGwTTKASEsmes7N76+1MKEJJaN5zj+3UFhQ='
WHERE
key_id = 'f13d52528cd6d5a3df8a1466a4bc2405a71bee0bca5ba80a2ceb9e895a3cd00a'
AND (
token = '8OBmb3+FKGwTTKASEsmes7N76+1MKEJJaN5zj+3UFhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)