UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E3stiCseHfw4Au6GdLYr6dz+upkKUl3YpsFPOge4AXk='
WHERE
key_id = '89f9da035b83ad7f03a8bf4d1e6d36cbf70a4c2ea09663c3ced2f0713259b1c8'
AND (
token = 'E3stiCseHfw4Au6GdLYr6dz+upkKUl3YpsFPOge4AXk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)