UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LrqQ6OHSOdZV2SiSNZtU1TRKHZoMGWAhdQRHhhqRYVg='
WHERE
key_id = 'a3ece0636cbed2a53f81a07864b46c53208818420ef799bf3c85152bf27a3335'
AND (
token = 'LrqQ6OHSOdZV2SiSNZtU1TRKHZoMGWAhdQRHhhqRYVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)