UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VTr1xnZBuSkaJaq2TbXs899rpGoPtReqTIU/C2CZ98A='
WHERE
key_id = 'c68ff2a4d21e27897eb8cb4511655e4e741597a43959a7f68fabe80ba98305cd'
AND (
token = 'VTr1xnZBuSkaJaq2TbXs899rpGoPtReqTIU/C2CZ98A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)