UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xZPkdP3WcLzdQDx6kzmnVpTv+JcQ00Mi0aYLHvz3/N8='
WHERE
key_id = 'fed632753fa098e60e7bf7ad895887b66550bba9ab4435ff3773457724f31019'
AND (
token = 'xZPkdP3WcLzdQDx6kzmnVpTv+JcQ00Mi0aYLHvz3/N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)