UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zy5YGiHsKL1Fc2XNPYRvJCGPf/zpmmYET7W33rPbMGM='
WHERE
key_id = 'cc1e2a7c2065e1713643952554c4bbae148cf0fa9821b92360cc6cf3380da615'
AND (
token = 'Zy5YGiHsKL1Fc2XNPYRvJCGPf/zpmmYET7W33rPbMGM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)