UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZXKSlf0UIaTqdjvoGtxAMMzWO7s02XLVj5sK8WNNKug='
WHERE
key_id = '4d513657975677c3283c54b5e3046fd4825b006697236b34380a4793c5493505'
AND (
token = 'ZXKSlf0UIaTqdjvoGtxAMMzWO7s02XLVj5sK8WNNKug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)