UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HAlkROtslOuR/BdYUuZowgFOf+wzc96tta0DdUYq+x0='
WHERE
key_id = 'd3a6c60d31d0cd2c1699cfdd7f6e8c7115ebea20e84d19450a86faac982f5e85'
AND (
token = 'HAlkROtslOuR/BdYUuZowgFOf+wzc96tta0DdUYq+x0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)