UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7uzpH+kUH2BN/9xHVmLY19Vup/+EVw1fIHLadfjFCdU='
WHERE
key_id = '7d915b7d5e3fbe609429b850d93a66e5693345389b0bd219d24c11b9a172958d'
AND (
token = '7uzpH+kUH2BN/9xHVmLY19Vup/+EVw1fIHLadfjFCdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)