UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eYt/XQyNwgH2X/WEFdfechlfMVgdbXCKSVDwMGMvBAc=' 
WHERE 
  key_id = '8cfaeda04844d7217cb06640967ad22514e67199526d7b5dc42a3f1544c00f16' 
  AND (
    token = 'eYt/XQyNwgH2X/WEFdfechlfMVgdbXCKSVDwMGMvBAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022