UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KSrHm2m2lkFIKCGtkEdfEHCj24iec5Lx/K2/GnYBixM='
WHERE
key_id = '5c6fcb8c8a7125cfa953c0ba69e248b55ba1ae2283959ad934f7adfea65a9e38'
AND (
token = 'KSrHm2m2lkFIKCGtkEdfEHCj24iec5Lx/K2/GnYBixM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)