UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7k3LnV8O+wkCzhU3ViqZcVHH+FAJR9IBA0RbpXq9608='
WHERE
key_id = '2e4d3bbbc89d564e06da3da4dede42c8c22a08eed01eb18a9fd09844c895c965'
AND (
token = '7k3LnV8O+wkCzhU3ViqZcVHH+FAJR9IBA0RbpXq9608='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)