UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wtJAJy4t12tYWy7NWmPT19YVHY9CEYsajGWxbCq10rE='
WHERE
key_id = 'f37e26171e0d135b3d076a7c9c272365d5b39f65f70d6fe16a1a324cf37e1291'
AND (
token = 'wtJAJy4t12tYWy7NWmPT19YVHY9CEYsajGWxbCq10rE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)