UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5fkbcDjWvYhPDtAj/7lyJkzKOdr7Yv1bQUCpIM7qymU='
WHERE
key_id = '25871b2106fc3ac804446f66d83c9a60fe1384aca2c9caed1f0e0ae2d2e1e7e0'
AND (
token = '5fkbcDjWvYhPDtAj/7lyJkzKOdr7Yv1bQUCpIM7qymU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)