UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sTXAVfDrwJ2KaJO2CSJZd6RNwX65zyGpTdjtj2B9hWk='
WHERE
key_id = '6a77aa7c76bf4eb75f5862fea088f6fadc5d5450d56cb935e06313d229f14659'
AND (
token = 'sTXAVfDrwJ2KaJO2CSJZd6RNwX65zyGpTdjtj2B9hWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)