UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'exe0plE1PxPIeRNLDB3AVGiIAq33kFrj6mN1yepSMxQ='
WHERE
key_id = '10f0872616feb71123d91072e8cf7cab5bfdfdb1a83c6120d5de12041bb80e4c'
AND (
token = 'exe0plE1PxPIeRNLDB3AVGiIAq33kFrj6mN1yepSMxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)